Storing and reading file paths from _TCHAR *argv[]
Posted
by
ArsenArsen
on Programmers
See other posts from Programmers
or by ArsenArsen
Published on 2014-08-25T07:21:44Z
Indexed on
2014/08/25
10:32 UTC
Read the original article
Hit count: 181
c++
|command-line
How to convert from _TCHAR* to "" and to keep all : and /? I tried:
int _tmain(int argc, _TCHAR* argv[])
{
if(!argv[1]){
std::cout<<"No Variables.\r\n";
system("PAUSE");
return 0;
std::exit;
}
std::cout<<"Path: "<<argv[1]<<"\r\n";
system("PAUSE");
return 0;
}
But, output is either "No variables." or "Path: C" (when I changed _TCHAR to const char and char) or either "Path: 00038706"
© Programmers or respective owner